package cn.iocoder.yudao.module.blog.service.casecomment;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.blog.controller.app.jiucase.vo.commentvo.AppBlogCaseCommentPageReqVO;
import cn.iocoder.yudao.module.blog.dal.dataobject.casecomment.BlogCaseCommentDO;
import cn.iocoder.yudao.module.blog.dal.dataobject.postcomment.BlogPostCommentDO;
import cn.iocoder.yudao.module.blog.dal.mysql.casecomment.BlogCaseCommentMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

@Service
@Validated
public class AppBlogCaseCommentServiceImpl implements AppBlogCaseCommentService{
    @Resource
    private BlogCaseCommentMapper caseCommentMapper;

    @Override
    public PageResult<BlogCaseCommentDO> getCaseCommentPage(AppBlogCaseCommentPageReqVO pageReqVO) {
        return caseCommentMapper.appSelectPage(pageReqVO);
    }

    @Override
    public Long getTotalCount(Long caseId) {
        return caseCommentMapper.selectCount(BlogCaseCommentDO::getCaseId, caseId);
    }
}
